#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e6 + 10, MOD = 998244353;

ll n;

ll ksm(ll a, ll b)
{
    ll res = 1;
    while (b) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD;b >>= 1;
    }
    return res;
}

void solve()
{
    cin >> n;
    ll inv2 = ksm(2, MOD - 2);
    ll ans = ((n % MOD) * ((n + 1) % MOD)) % MOD * inv2 % MOD;
    for (ll l = 1, r;l <= n;l = r + 1) {
        r = n / (n / l);
        ans = (ans - ((r - l + 1) * (n / l)) % MOD + MOD) % MOD;
    }
    cout << ans;
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}